<%@page import="entities.Domain"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="entities.SiteConfig"%>
<%@page import="java.util.TreeMap"%>
<%
	TreeMap check = (TreeMap) request.getAttribute("check");
	SiteConfig siteConfig = (SiteConfig) request.getAttribute("config");
	String image = UrlHelper.getServerUrl(request) + "/blobstore-serve?blob-key=" + siteConfig.getLogo();
	Domain domain = (Domain) request.getAttribute("domain");
	String domainName = (String) request.getAttribute("domainName");
%>


<jsp:include page="/demo/layouts/header.jsp">
    <jsp:param name="title" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="description" value="<%=siteConfig.getMetaDescription()%>" />
    <jsp:param name="keywords" value="<%=siteConfig.getMetaKeywords()%>" />
    <jsp:param name="ogsite_name" value="<%=siteConfig.getSiteName()%>" />
    <jsp:param name="ogtitle" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="ogurl" value="<%=UrlHelper.getServerUrl(request)%>" />
    <jsp:param name="ogimage" value="<%=image %>" />
    <jsp:param name="ogdescription" value="<%=siteConfig.getMetaDescription()%>" />
</jsp:include>

		<div class="dir">
			<a href="/home">Home</a> > Whois <%=domainName %>
		</div>
		<br />
		<div class="submit-form">
			<form action="" method="get">
			<table width="100%" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<td colspan="2"><div class="title-form">Search whois</div></td>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td width="30%" class="domain">
							Domain
						</td>
						<td>
							<input type="text" name="domain" value="<%=domainName %>">
							<br />
							<% if (check.get("domain") != null ) { %>
							<span class="error"><%=check.get("domain") %></span>
							<% } %>
						</td>
					</tr>
				</tbody>
				<tfoot>
					<tr>
						<td></td>
						<td>
							<button type="submit">Search >></button>
						</td>
					</tr>
				</tfoot>
			</table>
			</form>
		</div>
		
		<br />
		<% if (domain != null) { %>
		<div class="submit-form">
			<table width="100%" cellpadding="0" cellspacing="0">
				<thead>
					<tr>
						<td colspan="2"><div class="title-form"><%=domain.getDomain() %> - Whois</div></td>
					</tr>
				</thead>
				<tbody>
						<td>
							Whois
						</td>
						<td>
							<%=domain.getWhois() %>
						</td>
					</tr>
				</tbody>
			</table>
		</div>
		<% } else if(!domainName.isEmpty()) { %>
		<div class="submit-form msg">
		<table cellpadding="0" cellspacing="0" width="100%">
			<thead>
				<tr>
					<td><div class="title-form">Whois not found</div></td>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td align="center" class="txt-msg"><h3>Can't found whois for domain <%=domainName %></h3></td>
				</tr>
			</tbody>
		</table>
	</div>
		<% } %>
<jsp:include page="/demo/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>